Skip to content

feat: add f41 PDP deal support to deal tracker#609

Open
anjor wants to merge 3 commits intomainfrom
feat/f41-deal-tracker
Open

feat: add f41 PDP deal support to deal tracker#609
anjor wants to merge 3 commits intomainfrom
feat/f41-deal-tracker

Conversation

@anjor
Copy link
Collaborator

@anjor anjor commented Feb 5, 2026

Summary

Adds foundational support for f41 PDP (Proof of Data Possession) deals alongside legacy f05 market deals, while keeping this PR intentionally small.

This PR focuses on:

  • DealType support in the model/API/migration path
  • correctness fixes in PDP tracker piece_cid handling
  • targeted tests for PDP tracker upsert behavior

Scope in This PR

Model + API + Migration

  • Added DealType with values market (legacy f05) and pdp (f41)
  • Added DealType field on model.Deal with default market
  • Added PDP fields on model.Deal:
    • ProofSetID
    • ProofSetLive
    • NextChallengeEpoch
  • Added migration to backfill legacy deals to deal_type='market'
  • Added --deal-type filtering support to deal list (CLI + handler)

Worker / Tracker

  • Added PDPTracker worker type
  • Added PDP tracker scaffold
  • Fixed PDP tracker piece_cid behavior so it uses parsed CID values for lookup/insert
    • prevents duplicate inserts from mismatched CID query types
    • restores idempotent update behavior

Tests

  • Added focused PDP tracker tests for:
    • idempotent upsert (no duplicate rows)
    • update path on subsequent runs
    • invalid CID skip behavior

Follow-up Plan

  1. go-synapse integration PR
  • add go-synapse dependency
  • wire run pdp-tracker to a real go-synapse-backed PDPClient
  1. PDP transaction lifecycle PR
  • add transaction queue + confirmation handling for proof set creation/root addition
  1. Scheduling/dealpusher PDP PR
  • branch behavior by deal_type
  • enforce sequencing so uploads only occur after required on-chain confirmations
  1. PDP config/ops PR
  • add PDP-specific config (batch size, gas caps, confirmation depth, polling)
  • add metrics/logging around PDP lifecycle

Testing

  • Build passes
  • Existing tests pass
  • PDP tracker tests for CID/upsert correctness

anjor added 3 commits February 5, 2026 23:45
This commit adds support for tracking f41 PDP (Proof of Data Possession) deals
alongside legacy f05 market deals.

Changes:
- Add DealType field to Deal model (market vs pdp)
- Add PDP-specific fields: ProofSetID, ProofSetLive, NextChallengeEpoch
- Add migration to set deal_type='market' for existing deals
- Update deal tracker to set DealType when inserting market deals
- Add PDPTracker worker type and service stub
- Add pdp-tracker CLI command
- Add deal-type filter to deal list command

The PDPTracker service is a stub awaiting go-synapse integration (PR #2).
Once go-synapse is merged, the PDPClient interface will be implemented
to fetch proof set data from the PDPVerifier contract.

Part of: Filecoin Foundation contract milestone 1
The DealType field had an inline comment which caused swag to generate
an 'allOf' wrapper in the OpenAPI spec. This caused go-swagger to generate
a struct wrapper type that couldn't unmarshal plain JSON strings.

Removed the inline comment and regenerated swagger to use a direct $ref,
matching how DealState is handled.

Fixes the failing test:
- json: cannot unmarshal string into Go struct field ModelDeal.dealType of type struct { models.ModelDealType }
@anjor anjor requested a review from parkan February 6, 2026 11:03
@anjor anjor marked this pull request as ready for review February 6, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant